package com.syedu.day10.example2;

/**
 * description：
 * @author Administrator
 * @date 2022/3/21 15:28
 */
public class VehicleFactory implements IConstants{
    public static Vehicle getVehice(int type){
        Vehicle vehicle = null;
        if(type == BIKE){
            vehicle = new Bike();
        }else if(type == CAR){
            vehicle = new Car();
        }else if(type == PLANE){
            vehicle = new Plane();
        }else{
            System.out.println("参数不合法...");
        }
        return vehicle;
    }
}